Get alternate records in a table like as
| Name | RollNo | Marks |
| A | 1 | 40 |
| B | 2 | 50 |
| C | 3 | 55 |
| D | 4 | 48 |
| E | 6 | 66 |
how can get 2nd, 4th, and 6th position of marks ?
home / developersection / forums / how can get alternate highest salary or any record in a table in sql server ?
Get alternate records in a table like as
| Name | RollNo | Marks |
| A | 1 | 40 |
| B | 2 | 50 |
| C | 3 | 55 |
| D | 4 | 48 |
| E | 6 | 66 |
how can get 2nd, 4th, and 6th position of marks ?
Koi Ken
06-Aug-2018Anonymous User
03-Aug-2018USE DENSE_RANK FUNCTION for this operation.
MSSQL DENSE_RANK FUNCTION SYNTAX